<#assign nojs=true>
<#include "/WEB-INF/default/fragment/header.ftl">
<body>

<script type="text/javascript" src="${request.contextPath}/assets/js/jquery.js"></script>
<script src="//cdn.bootcss.com/moment.js/2.10.6/moment.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/assets/js/bootstrap.min.js"></script>

<#include "/WEB-INF/default/fragment/nav.ftl">

<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker-standalone.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>

<style>
.legend {
  border-bottom: 1px solid red;
  padding: 0px;
}
fieldset {
  width: 80%;
  margin: 0 auto;
}
</style>
<div class="container">
  <div class="tms-logo"><img class="center-block" src="${request.contextPath}/assets/images/logo.png" alt=""></div>
</div>

<div class="container">
<form class="form-horizontal" action="${request.contextPath}/team-post.action" method="post">
  <input type="hidden" class="form-control" name="team.id" value="<#if team?? && team.id??>${team.id}</#if>">

  <legend class="clearfix">
    <div class="pull-left"><h4>${title}</h4></div>
    <div class="pull-right">
      <a href="${request.contextPath}/team-post.action" class="btn btn-default">新增团队</a>
    </div>
  </legend>
  <div>
    <table class="table">
      <thead>
        <tr>
          <td>团队id</td>
          <td>团队名称</td>
          <td>团队描述</td>
          <td>个性域名</td>
          <td>成员</td>
          <td>开始、结束时间</td>
          <td>团队状态</td>
          <td>完成度</td>
          <td>操作</td>
        </tr>
      </thead>
      <tbody>
        <#list teams as team>
        <tr>
          <td>${team.id}</td>
          <td><a href="${request.contextPath}/team-${team.id}.action">${team.name}</a></td>
          <td>${team.desc}</td>
          <td>${team.subdomain}</td>
          <td>${team.userCount}</td>
          <td>${(team.gmtBegin*1000)?number_to_date?string("yyyy-MM-dd") }&nbsp;/&nbsp;${(team.gmtEnd*1000)?number_to_date?string("yyyy-MM-dd")}</td>
          <td>
            <#if team?exists && team.status == 1>尚未开始</#if>
            <#if team?exists && team.status == 2>正在实训中</#if>
            <#if team?exists && team.status == 3>毕业项目实战</#if>
            <#if team?exists && team.status == 4>完成实训</#if>
            <#if team?exists && team.status == 5>结束团队</#if>
          </td>
          <td>
              <@team_process team.gmtBegin team.gmtEnd />
          </td>
          <td class="btn-group-xs">
            <a href="${request.contextPath}/team-detail.action?team.id=${team.id}" class="btn btn-primary btn-xs">修改</a>
            <a href="${request.contextPath}/team-invite.action?team.id=${team.id}" class="btn btn-success btn-xs">邀请</a>
          </td>
        </tr>
        <#else>
        <tr>
          <td colspan="9">您还没有创建过团队哦，请<a href="${request.contextPath}/team-post.action">新增团队</a></td>
        </tr>
        </#list>
      </tbody>
    </table>
  </div>
</form>
</div>

</body>
<#include "/WEB-INF/default/fragment/footer.ftl">
